package com.youdoneed.community.forum.web;

import com.youdoneed.community.common.vo.ResultMessage;
import com.youdoneed.community.forum.service.SystemReportService;
import com.youdoneed.community.systemReport.SystemReportVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by lid on 2017/8/5 0005.
 * 获取系统的今日情况
 */

@RestController
@RequestMapping(value = "/systemReport", method = {RequestMethod.GET, RequestMethod.POST})
@Api(value = "获取系统数据模块控制器", description = "获取系统的今日情况模块控制器")
public class SystemReportController {
    private static final Logger logger = LoggerFactory.getLogger(SystemReportController.class);

    @Autowired
    SystemReportService systemReportService;

    @RequestMapping(value = "/getSystemReport", method = {RequestMethod.GET, RequestMethod.POST})
    @ApiOperation(notes = "获取系统的今日情况", value = "获取系统的今日情况")
    public ResultMessage<SystemReportVo> getSystemReport() {
        SystemReportVo vo = systemReportService.getSystemReport();
        if (null == vo) {
            return ResultMessage.newFailure("获取系统的今日情况失败");
        }
        return ResultMessage.newSuccess("获取系统的今日情况成功！").setData(vo);
    }
}
